<HTML><HEAD><TITLE>begin_module(+Module)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Obsolete</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>begin_module(+Module)</H1>
Start the definition of the body of the Module.


<DL>
<DT><EM>Module</EM></DT>
<DD>Atom.
</DD>
</DL>
<H3>This built-in predicate is obsolete!</H3>
<H2>Description</H2>
   This is a directive that can occur only in a compiled file.  Module must
   be an existing, non-locked module.  All following code will be added to
   the module Module up to the next begin_module/1 or module_interface/1
   directive or up to the file end.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>begin_module(+) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Module is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Module is not an atom.
<DT><EM>(68) calling an undefined procedure </EM>
<DD>When called from Prolog.
<DT><EM>(80) not a module </EM>
<DD>Module is not a module.
<DT><EM>(82) trying to access a locked module </EM>
<DD>Module is locked.
</DL>
<H2>Examples</H2>
<PRE>
Success:
     [eclipse 2]: [user].
     :- module_interface(m).
     :- op(700, xf, there).
     :- export p/1.
     :- begin_module(m).
      p(X) :- writeln(X).
      user compiled 56 bytes in 0.03 seconds
     yes.
     [eclipse 3]: p(hello there).
     syntax error: postfix/infix operator expected
     | p(hello there).
     |             ^ here
     [eclipse 3]: use_module(m).

     yes.
     [eclipse 4]: p(hello there).
     hello there

     yes.

Error:
    begin_module(M).                 (Error 4).
    begin_module(1).                 (Error 5).
    begin_module(a_locked_module).   (Error 82).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/modules/module-1.html">module / 1</A>, <A HREF="../../kernel/modules/create_module-1.html">create_module / 1</A>, <A HREF="../../kernel/modules/erase_module-1.html">erase_module / 1</A>, <A HREF="../../kernel/modules/current_module-1.html">current_module / 1</A>, <A HREF="../../kernel/obsolete/module_interface-1.html">module_interface / 1</A>
</BODY></HTML>
